<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" errorPage="~/Error.aspx" Codebehind="ViewMeeting.aspx.cs"
    Inherits="SecurityLinkUp.ViewMeeting" Title="View Meeting" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="PietschSoft.VE" Namespace="PietschSoft.VE" TagPrefix="PietschSoftVE" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="server">
<script type="text/javascript">
    var elementuid;
    
    function ShowPopup(uid)
    {    
        elementuid = uid;
        
        // have to strip out the part that names the control, leaving the user id
        var pos = uid.indexOf("-");
        var userid = uid.substr(pos+1);
        
        // call the web service to get the user profile
        SecurityLinkUp.WebServices.GetUserProfilePopupHTML(userid,SucceededCallback, FailedCallback);
    }
  
    function SucceededCallback(result)
    {
        var itm = document.getElementById(elementuid);
        var xy = findPos(itm);
        var popup = document.getElementById("userprofilepopup");
        
        popup.innerHTML = result;
        
        popup.style.top = xy[1];
        popup.style.left = xy[0] + 100;
        popup.style.visibility = "Visible";    
    }
    
    function FailedCallback(error)
    {
        SucceededCallBack("Error in getting user profile!");
    }
    
    function HidePopup()
    {
        var popup = document.getElementById("userprofilepopup");
        popup.style.visibility = "Hidden";
    }
    
    function findPos(obj) 
    {
	    var curleft = curtop = 0;
	    if (obj.offsetParent) {
		    curleft = obj.offsetLeft
		    curtop = obj.offsetTop
		    while (obj = obj.offsetParent) {
			    curleft += obj.offsetLeft
			    curtop += obj.offsetTop
		    }
	    }
	    return [curleft,curtop];
    }


</script>

    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
        <Services>
            <asp:ServiceReference Path="~/WebServices.asmx" InlineScript="true" />
        </Services>
    </asp:ScriptManagerProxy>

    <table cellpadding="10">
        <tr>
            <td valign="top">
                Meeting Info
                <table>
                    <tr>
                        <td>
                            Organizer</td>
                        <td>
                            <asp:Label ID="Organizer" runat="server" Text=""></asp:Label></td>
                    </tr>
                    <tr>
                        <td>
                            Meeting Title</td>
                        <td>
                            <asp:Label ID="MeetingTitle" runat="server" Text=""></asp:Label></td>
                    </tr>
                    <tr>
                        <td>
                            Start</td>
                        <td>
                            <asp:Label ID="Start" runat="server" Text=""></asp:Label></td>
                    </tr>
                    <tr>
                        <td>
                            End</td>
                        <td>
                            <asp:Label ID="End" runat="server" Text=""></asp:Label></td>
                    </tr>
                    <tr>
                        <td>
                            Description</td>
                        <td>
                            <asp:Label ID="Description" runat="server" Text=""></asp:Label></td>
                    </tr>
                    <tr>
                        <td>
                            Location</td>
                        <td>
                            <asp:Label ID="location" runat="server" Text=""></asp:Label></td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <asp:HyperLink ID="MeetingLink" runat="server" Width="268px"></asp:HyperLink></td>
                    </tr>
                </table>
                <asp:Panel ID="RSVPPanel" runat="server" Width="300px" Visible="false">
                    <asp:Panel ID="RSVPHeader" runat="server" Width="300px">
                        <div style="float: left;">RSVP</div>
                        <div style="float: right; vertical-align: middle;">
                            <asp:ImageButton ID="RSVPExpandBtn" runat="server" ImageUrl="~/Images/expand.png" />
                        </div>
                    </asp:Panel>
                    <asp:Panel ID="RSVPContent" Width="300px" runat="server">
                        <asp:RadioButton GroupName="RSVPStatus" ID="WillAttendRB" Text="I will be attending" runat="server" />
                        <asp:RadioButton GroupName="RSVPStatus" ID="WillNotAttendRB" Text="I will not be attending" runat="server" />
                        <asp:RadioButton GroupName="RSVPStatus" ID="UndecidedRB" Text="Not sure yet" runat="server" />
                        <br />
                        <br />
                        Message<br />
                        <asp:TextBox ID="RSVPMessage" Rows="3" runat="server" Height="33px" Width="243px"></asp:TextBox>
                        <asp:Button ID="SaveRSVPBtn" runat="server" Text="Save" OnClick="SaveRSVPBtn_Click" /><br />
                        <asp:Label ID="RSVPErrorMessage" runat="server" CssClass="ErrorMessage"></asp:Label>
                    </asp:Panel>
                    </asp:Panel>
                <cc1:CollapsiblePanelExtender ID="RSVPPanelExtender" runat="server" TargetControlID="RSVPContent"
                    ExpandControlID="RSVPHeader" CollapseControlID="RSVPHeader"
                    Collapsed="True" ImageControlID="RSVPExpandBtn" ExpandedImage="~/Images/collapse.png"
                    CollapsedImage="~/Images/expand.png" SuppressPostBack="true" />
            </td>
            <td valign="top">
                Location Info<br />
                <div style="float: left">
                    <PietschSoftVE:Map runat="server" ID="Map" Width="400" Height="250" Zoom="0" Latitude="20.0"
                        Longitude="10.0" ShowDashboard="false" />
                </div>
                <asp:Panel ID="LocationPanel" runat="server" Height="50px" Width="125px" Visible="false">
                    Help me get to this meeting!<br />
                    <asp:Button ID="FromProfileLocation" runat="server" Text="From my profile location" />&nbsp;
                    <asp:Button ID="FromFindLocation" runat="server" Text="Let me search" />
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td valign="top">
                Attendees<br />
                <div style="width: 300px; height: 150px; overflow: auto; float: left">
                    <asp:PlaceHolder ID="AttendeesPlaceholder" runat="server"></asp:PlaceHolder>
                </div>
            </td>
            <td valign="top">
                Presentatons<br />
                <div style="width: 300px; height: 150px; overflow: auto; float: left">
                    <asp:PlaceHolder ID="PresentationsPlaceHolder" runat="server"></asp:PlaceHolder>
                </div>
                <div>
                    <asp:Panel ID="UploadPresentationPanel" runat="server" Width="300px" Visible="false">
                        <asp:Panel ID="UploadPresentationHeader" runat="server" Width="300px">
                            <div style="float: left;">
                                Submit a presentation</div>
                            <div style="float: right; vertical-align: middle;">
                                <asp:ImageButton ID="PresentationsExpandBtn" runat="server" ImageUrl="~/Images/expand.png" />
                            </div>
                        </asp:Panel>
                        <asp:Panel ID="UploadPresentationContent" Width="300px" runat="server">
                            <table>
                                <tr>
                                    <td>
                                        Title</td>
                                    <td>
                                        <asp:TextBox ID="PresentationTitle" runat="server"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>
                                        Abstract</td>
                                    <td>
                                        <asp:TextBox ID="Abstract" Rows="5" runat="server"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>
                                        Duration</td>
                                    <td>
                                        <asp:DropDownList ID="Duration" runat="server">
                                            <asp:ListItem>15 Minutes</asp:ListItem>
                                            <asp:ListItem>30 Minutes</asp:ListItem>
                                            <asp:ListItem>45 Minutes</asp:ListItem>
                                            <asp:ListItem>1 Hour</asp:ListItem>
                                        </asp:DropDownList></td>
                                </tr>
                                <tr>
                                    <td>
                                        File</td>
                                    <td>
                                        <asp:FileUpload ID="PresentationFile" runat="server" /></td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td align="right">
                                        <asp:Button ID="SubmitPresentationBtn" runat="server" Text="Submit" OnClick="SubmitPresentationBtn_Click" /><br />
                                        <asp:Label ID="SubmitPresentationErrorMessage" runat="server" CssClass="ErrorMessage"></asp:Label></td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </asp:Panel>
                    <cc1:CollapsiblePanelExtender ID="UploadPanelExtender" runat="server" TargetControlID="UploadPresentationContent"
                        ExpandControlID="UploadPresentationHeader" CollapseControlID="UploadPresentationHeader"
                        Collapsed="True" ImageControlID="PresentationsExpandBtn" ExpandedImage="~/Images/collapse.png"
                        CollapsedImage="~/Images/expand.png" SuppressPostBack="true" />
                </div>
            </td>
        </tr>
    </table>
    
    <div id="userprofilepopup" style="visibility:hidden; position:absolute; top:0; left:0;"></div>

    
</asp:Content>
